package zzzhc.image.recognize.nn;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;

import org.joone.net.NeuralNet;

public class NNLoader {
	private NeuralNet neuralNet;

	private TrainResult trainResult;

	public boolean load(InputStream in) throws IOException {
		ObjectInputStream ois = new ObjectInputStream(in);
		try {
			neuralNet = (NeuralNet) ois.readObject();
			trainResult = (TrainResult) ois.readObject();
			return true;
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			return false;
		}
	}

	public NeuralNet getNeuralNet() {
		return neuralNet;
	}

	public TrainResult getTrainResult() {
		return trainResult;
	}

}
